We propose to combine whole brain 2-photon imaging of neural activity in behaving larval zebrafish with detailed anatomical and connectivity information extracted from the same animals. The final goal is to generate quantitative models of brain wide neural circuits that explain the dynamic processing of sensory information as well as the generation of motor output by these circuits. Anatomical data will be generated by two complementary technologies: 1) whole brain EM data sets will be prepared from the same fish that were used for calcium imaging. Respective data sets will be registered to each other, functionally relevant neuronal ensembles will then be identified in the EM stacks and connectivity will be analyzed in these sub-networks via sparse reconstruction. 2) EM based connectivity information will be supplemented by trans-synaptic viral tracing technology. These two technologies for identifying synaptic connections have complementary strengths and weaknesses and are thus ideally suited for combination with in-vivo 2-photon calcium imaging studies. The specific power of this approach is that all three techniques, whole brain calcium imaging, viral tracing and EM reconstruction, can be done in the same animal. Functional, anatomical and behavioral data can then be analyzed in the context of the specific stimuli and quantified behavioral output and subsequently synthesized into a theoretical framework. To that end we will start with quantitative models of simple reflex behaviors, like the optomotor and optokinetic reflex, where the transformation of sensory input to motor output is relatively straightforward and well defined. These elementary models will serve as a scaffold that can be refined and complemented by additional data from structure function studies from fish performing in more sophisticated behavioral assays that involve more complex stimuli, different modalities and plastic changes. As such the process of building such a virtual fish will be an iterative, open ended process that requires continuous and bidirectional exchange of information between the theoretical and experimental groups of the research team.